package org.csu.gp_store.bo;

import lombok.Data;
import org.csu.gp_store.entity.BrowsingHistory;

import java.math.BigDecimal;

@Data
public class BrowsingHistoryBO {

    private String accountID;
    private String productID;
    private String productName;
    private String description;
    private String image;
    private int status;
    private BigDecimal minPrice;
    private BigDecimal maxPrice;


    public static BrowsingHistoryBO toBrowsingHistoryBO(ProductBO productBO, BrowsingHistory browsingHistory){
        BrowsingHistoryBO browsingHistoryBO=new BrowsingHistoryBO();
        browsingHistoryBO.setAccountID(String.valueOf(browsingHistory.getAccountID()));
        browsingHistoryBO.setProductID(String.valueOf(browsingHistory.getProductID()));
        browsingHistoryBO.setProductName(productBO.getProductName());
        browsingHistoryBO.setDescription(productBO.getDescription());
        browsingHistoryBO.setImage(productBO.getImage());
        browsingHistoryBO.setStatus(productBO.getStatus());
        browsingHistoryBO.setMaxPrice(productBO.getMaxPrice());
        browsingHistoryBO.setMinPrice(productBO.getMinPrice());
        return browsingHistoryBO;
    }
}
